﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PO_2011
{
    public partial class PopupFilter : Form
    {
        private String type;
        private Gimp gimp;

        public PopupFilter(Gimp gimp, String type)
        {
            InitializeComponent();
            this.type = type;
            this.gimp = gimp;

            this.mask_size.SelectedItem = "3";
        }

        private void filter_button_creator_Click(object sender, EventArgs e)
        {
            this.gimp.imageBox.Image = Filter.Filter.create(new Bitmap(this.gimp.imageBox.Image), this.type, Convert.ToInt16(this.mask_size.SelectedItem));
            this.gimp.imageBox.Refresh(); 
            this.Close();
        }

        public void filterGaussForLog()
        {
            this.gimp.imageBox.Image = Filter.Filter.create(new Bitmap(this.gimp.imageBox.Image), this.type, 3);
        }

    }
}
